//
//  RootView.m
//  UI3_UIImageView课后作业
//
//  Created by dllo on 15/11/10.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "RootView.h"

@interface RootView ()<UITextFieldDelegate>

@end



@implementation RootView

- (void)dealloc
{
    [_label release];
    [_textF release];
    [_imageV release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createSubviews];
        
    }
    return self;
}

- (void)createSubviews
{
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width / 3.0, self.frame.size.height)];
    self.label.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.label];
    [_label release];
    
    self.textF = [[UITextField alloc] initWithFrame:CGRectMake(self.label.frame.size.width + 15, 0, self.frame.size.width * 2 / 3.0 - 20, self.frame.size.height)];
    self.textF.borderStyle = UITextBorderStyleNone;
    self.textF.clearButtonMode = UITextFieldViewModeAlways;
    self.textF.alpha = 1.0;
    // textField 回收键盘协议
    self.textF.delegate = self;
    [self addSubview:self.textF];
    [_textF release];
    
    self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(self.label.frame.size.width, 0, self.frame.size.width * 2 / 3.0, self.frame.size.height)];
    self.imageV.image = [UIImage imageNamed:@"login_editor"];
    self.imageV.alpha = 0.5;
    [self addSubview:self.imageV];
    [_imageV release];
    
    
    
}
    // textField 回收键盘协议
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}






@end
